#pragma once



/*============================================================================
'File Name   : thinCore.inc
'Author      : Eros Olmi
'Version     : 1.9.16.x
'Description : thinBasic external library Interface definitions
'Web site    : http://www.thinbasic.com
'=============================================================================
'COPYRIGHT And PERMISSION NOTICE
'=============================================================================
'Copyright (c) 2003 - 2016, Eros Olmi, <eros.olmi@thinbasic.com>
' 
'All rights reserved.
' 
'Permission To use this software Is granted Only For the purpose To develop
'thinBasic language modules both For commercial Or non commercial purpose.
'In Any Case the above copyright notice And this permission notice must appear
'In All Copies.
' 
'THE SOFTWARE Is PROVIDED "AS IS", WITHOUT WARRANTY Of Any KIND, EXPRESS Or
'IMPLIED, INCLUDING BUT Not LIMITED To THE WARRANTIES Of MERCHANTABILITY,
'FITNESS For A PARTICULAR PURPOSE And NONINFRINGEMENT Of THIRD PARTY RIGHTS.
'In NO EVENT SHALL THE AUTHORS Or COPYRIGHT HOLDERS BE LIABLE For Any CLAIM,
'DAMAGES Or OTHER LIABILITY, WHETHER In AN ACTION Of CONTRACT, TORT Or
'OTHERWISE, ARISING From, Out Of Or In CONNECTION With THE SOFTWARE Or THE
'USE Or OTHER DEALINGS In THE SOFTWARE.
'
'=============================================================================
'Edit History [+]Add, [-]Fixed, [*]Changed, [N]Note
'_____________________________________________________________________________
'Date_______Type_Note_________________________________________________________
'
'2010/08/21 [+]  thinBasic_Class_Add()         
'===========================================================================*/



// remark : xLeaves 2019.07.15



/*-----------------------------------------------------------------------------
' Global declares
'----------------------------------------------------------------------------*/
#define thinBasic_DoNotForceOverWrite		0
#define thinBasic_ForceOverWrite			1		// Used in thinBasic_LoadSymbol to force symbol over writing

#define VarMainType_IsNumber				20
#define VarMainType_IsString				30
#define VarMainType_IsAsciiZ				25
#define VarMainType_IsVariant				50

#define VarSubType_Byte						1
#define VarSubType_Integer					2
#define VarSubType_Word						3
#define VarSubType_DWord					4
#define VarSubType_Long						5
#define VarSubType_Quad						6
#define VarSubType_Single					7
#define VarSubType_Double					8
#define VarSubType_Currency					9
#define VarSubType_Ext						10
#define VarSubType_Variant					50


/*-----------------------------------------------------------------------------
' Return Types from functions/Subs
'----------------------------------------------------------------------------*/
#define thinBasic_ReturnNone				0		// Used in thinBasic_LoadSymbol to define a sub
#define thinBasic_ReturnCodeNone			thinBasic_ReturnNone

#define thinBasic_ReturnNumber				20		// Used in thinBasic_LoadSymbol to define a function returning a EXT number
#define thinBasic_ReturnCodeNumber			thinBasic_ReturnNumber

#define thinBasic_ReturnString				30		// Used in thinBasic_LoadSymbol to define a function returning a string
#define thinBasic_ReturnCodeString			thinBasic_ReturnString

#define thinBasic_ReturnVariant				50
#define thinBasic_ReturnCodeVariant			thinBasic_ReturnVariant

#define thinBasic_ReturnUDT					60
#define thinBasic_ReturnCodeUDT				thinBasic_ReturnUDT


#define thinBasic_ReturnCodeByte			1
#define thinBasic_ReturnCodeInteger			2
#define thinBasic_ReturnCodeWord			3
#define thinBasic_ReturnCodeDWord			4
#define thinBasic_ReturnCodeLong			5
#define thinBasic_ReturnCodeQuad			6
#define thinBasic_ReturnCodeSingle			7
#define thinBasic_ReturnCodeDouble			8
#define thinBasic_ReturnCodeCurrency		9
#define thinBasic_ReturnCodeExt				10
//-----------------------------------------------------------------------------

#define thinBasic_BufferType_IsFile			0
#define thinBasic_BufferType_IsScript		1

#define thinBasic_CallingProgram_GUI		1
#define thinBasic_CallingProgram_Console	2

//-----------------------------------------------------------------------------

#define thinBasic_TRUE						1
#define thinBasic_FALSE						0
#define thinBasic_ON						1
#define thinBasic_OFF						0

//-----------------------------------------------------------------------------





extern "C"
{
	/*---------------------------------------------------------------------------
	'thinBasic_Init / thinBasic_Run / thinBasic_Release
	'----------------------------------------------------------------------------
	' Description
	'   the 3 functions to call in sequence in order to execute a script
	'   when using thinCore.dll (thinBasic engine) as embedded scripting language
	'
	' 
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_Init(HWND hWnd, int cInstance, char* sKey);
	int			__declspec(dllexport) thinBasic_Run(int hScript, char* sBuffer, int BufferType, int Options, int DebugMode, int LogMode, int ObfuscateMode, int CallingProgram, int DependancyMode);
	int			__declspec(dllexport) thinBasic_Release(int hScript);



	/*---------------------------------------------------------------------------
	'thinBasic_AddIncludePath
	'----------------------------------------------------------------------------
	' Description
	'   when a file us specified in #INCLUDE withou a fully qualified path
	'   thinBasic will search for the file using script or executable path
	'   If not found, thinBasic will search in some directories specified by #INCLUDEDIR.
	'   This function is the equivalent of #INCLUDEDIR but executed from the aoutside
	'   of the script
	'
	' Parameters
	'   sNewIncludeDir  : full path of the new include dir when thinBasic will serach fon files
	'                     specified in #INCLUDE
	'
	'   ReturnCode  : None
	'   
	'   Call this function after thinBasic_Init but before thinBasic_Run
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_AddIncludePath(char* sNewIncludeDir);



	/*---------------------------------------------------------------------------
	'thinBasic_LoadSymbol
	'----------------------------------------------------------------------------
	' Description
	'   Creates e new keyword inside interpreter.
	'   You define your own Function or Sub inside your program. Then call
	'   thinBasic_LoadSymbol to add a new keyword connected to your new function/sub
	'
	' Parameters
	'   SymbolName  : Name you want to give to your sub or function inside the
	'                 interpreter. It is the new keyword name.
	'
	'   ReturnCode  : specify what kind of var your function returns
	'                 Use predefined constants:
	'                 %thinBasic_ReturnNumber
	'                 %thinBasic_ReturnString
	'                 %thinBasic_ReturnNone
	'                 If SymbolName will end with "$" char, ReturnCode will
	'                 be forced to %thinBasic_ReturnString
	'                 Note: if you pass a pointer to a SUB routine and ReturnCode
	'                       is different from %thinBasic_ReturnNone, a GPF will be
	'                       fired by the Operating System.
	'                 Note: if ReturnCode <= 0 then %thinBasic_ReturnNone will be
	'                       assumed 
	'
	'   FunctionOrSubPointer:
	'                 DWORD returned by CODEPTR function pointing to the function
	'                 that will be called when SymbolName keyword will be encountered
	'                 during script execution
	'
	'   ForceOverWrite:
	'                 If different from 0 it means that even if SymbolName
	'                 already exists as a keyword, you want to overwrite it with
	'                 a new one.
	'                 For example, if you want to overwrite behave of MID$
	'                 creating your own MID$ function, set this parameter to a value
	'                 > 0 like in this example:
	'                 thinBasic_LoadSymbol("MID$", %thinBasic_ReturnString, CODEPTR(MyMid), 1)
	'
	' Possible Return Code
	'   >0 = no error, return the associated SymbolName ID
	'   -1 = empty SymbolName
	'   -2 = duplicated SymbolName and no ForceOverWrite flag
	'   -3 = invalid sub/function pointer
	'   -4 = SymbolName contains invalid char(s)
	'
	' Example
	'   thinBasic_LoadSymbol "MyNewFunction", %thinBasic_ReturnNumber, CODEPTR(MyFunc)
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) _thinBasic_LoadSymbol(char* SymbolName, int ReturnCode, void* FunctionOrSubPointer, int ForceOverWrite);
	#define thinBasic_LoadSymbol _thinBasic_LoadSymbol



	/*---------------------------------------------------------------------------
	'thinBasic_LoadSymbolEX
	'----------------------------------------------------------------------------
	' Description
	'   Creates e new keyword inside interpreter.
	'   You define your own Function or Sub inside your program. Then call
	'   thinBasic_LoadSymbol to add a new keyword connected to your new function/sub
	'
	' Parameters
	'   SymbolName  : Name you want to give to your sub or function inside the
	'                 interpreter. It is the new keyword name.
	'
	'   ReturnCode  : specify what kind of var your function returns
	'                 Use predefined constants:
	'                 %thinBasic_ReturnNumber
	'                 %thinBasic_ReturnString
	'                 %thinBasic_ReturnNone
	'                 If SymbolName will end with "$" char, ReturnCode will
	'                 be forced to %thinBasic_ReturnString
	'                 Note: if you pass a pointer to a SUB routine and ReturnCode
	'                       is different from %thinBasic_ReturnNone, a GPF will be
	'                       fired by the Operating System.
	'                 Note: if ReturnCode <= 0 then %thinBasic_ReturnNone will be
	'                       assumed 
	'
	'   FunctionOrSubPointer:
	'                 DWORD returned by CODEPTR function pointing to the function
	'                 that will be called when SymbolName keyword will be encountered
	'                 during script execution
	'
	'   ForceOverWrite:
	'                 If different from 0 it means that even if SymbolName
	'                 already exists as a keyword, you want to overwrite it with
	'                 a new one.
	'                 For example, if you want to overwrite behave of MID$
	'                 creating your own MID$ function, set this parameter to a value
	'                 > 0 like in this example:
	'                 thinBasic_LoadSymbol("MID$", %thinBasic_ReturnString, CODEPTR(MyMid), 1)
	'   sSyntax:
	'                 Syntax of the symbol name
	'   sHelp:
	'                 help about the symbol name
	'
	' Possible Return Code
	'   >0 = no error, return the associated SymbolName ID
	'   -1 = empty SymbolName
	'   -2 = duplicated SymbolName and no ForceOverWrite flag
	'   -3 = invalid sub/function pointer
	'   -4 = SymbolName contains invalid char(s)
	'
	' Example
	'   thinBasic_LoadSymbol "MyNewFunction", %thinBasic_ReturnNumber, CODEPTR(MyFunc)
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_LoadSymbolEX(char* SymbolName, int ReturnCode, DWORD FunctionOrSubPointer, int ForceOverWrite, char* sSyntax, char* sHelp);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableGetList
	'----------------------------------------------------------------------------
	' Returns a string with the list of all variables of a specific stack level
	' If StackLevel is missing, current stack level will be returned
	'--------------------------------------------------------------------------*/
	LPCSTR		__declspec(dllexport) thinBasic_VariableGetList(int lStackLevel, char* sSep);

	

	/*---------------------------------------------------------------------------
	'thinBasic_VariableExists
	'----------------------------------------------------------------------------
	' Returns true/false depending if the given name is a variable or not
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableExists(char* sName);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableGetValueNum
	'----------------------------------------------------------------------------
	' Returns numeric value of a numeric variable given variable name and optionally array index
	'--------------------------------------------------------------------------*/
	long double	__declspec(dllexport) thinBasic_VariableGetValueNum(char* SearchKey, int lIndex);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableGetInfo
	'----------------------------------------------------------------------------
	' Returns additional variable info giving variable name.
	' ATTENTION: pass variable as reference. Function will populate
	'            with relevant information
	' Function returns a pointer to internal thinBAsic variable structure data
	' that can be used in other situations.
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableGetInfo(char* SearchKey, int* MainType, int* SubType, int* IsArray);
	int			__declspec(dllexport) thinBasic_VariableGetInfoPtr(int pVariable, int* MainType, int* SubType, int* IsArray);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableGetInfoEX
	'----------------------------------------------------------------------------
	' Returns additional variable info giving variable name.
	' ATTENTION: pass variable as reference. Function will populate
	'            with relevant information
	' Function returns a pointer to internal thinBAsic variable structure data
	' that can be used in other situations.
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableGetInfoEX(char* SearchKey, int* MainType, int* SubType, int* IsArray, int* DataPtr, int* nElements, int WhichLevel);

	//---Equates for variable Sub Type
	#define SubType_Byte						1
	#define SubType_Integer						2
	#define SubType_Boolean						2
	#define SubType_Word						3
	#define SubType_DWord						4
	#define SubType_Long						5
	#define SubType_Quad						6
	#define SubType_Single						7
	#define SubType_Double						8
	#define SubType_Currency					9
	#define SubType_Ext							10

	#define MainType_IsNumber					20

	#define SubType_AsciiZ						25
	#define SubType_String						30

	#define MainType_GUID						40
	#define MainType_String						SubType_String

	#define MainType_Variant					50
	#define MainType_UDT						60
	#define MainType_PTR						70
	#define MainType_Object						80
	#define MainType_Class						90
	#define MainType_Function					95
	#define MainType_Dispatch					100



	/*---------------------------------------------------------------------------
	'thinBasic_VariableIsArray
	'----------------------------------------------------------------------------
	' Returns true/false depending if given name is an array
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableIsArray(char* vName);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableRedim
	'----------------------------------------------------------------------------
	' Redim a variable giving variable ptr
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableRedim(int pVar, int lPreserve, int VarDim1, int VarDim2, int VarDim3);



	/*---------------------------------------------------------------------------
	'thinBasic_ArrayGetElements
	'----------------------------------------------------------------------------
	' Returns total number of elements inside an array giving the array name
	' ATTENTION: this function works on single or multi dimensions arrays
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ArrayGetElements(char* vName);



	/*---------------------------------------------------------------------------
	'thinBasic_ArrayGetPtr
	'----------------------------------------------------------------------------
	' Returns the data structure pointer of an array giving its name
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ArrayGetPtr(char* vName);



	/*---------------------------------------------------------------------------
	'thinBasic_ArrayGetInfo
	'----------------------------------------------------------------------------
	' Returns information on an array passing array pointer returned by thinBasic_ArrayGetPtr
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ArrayGetInfo(int ArrayPtr, int InfoType);

	//---Equates for InfoType
	#define Array_ElementsCount					1		// Total number of elements in the array
	#define Array_ElementSize					2		// The size of the single element (for example an array of LONGs will return 4)
	#define Array_Dimensions					3		// Number of dimensions (from 1 to 3)
	#define Array_Size							4		// Memory size allocated for the array. This will not compute the memory needed for strings
	#define Array_ElementsType					10		// Type of elements strored into the array. See equates for thinBasic_VariableGetInfo
	#define Array_ElementsAreFixed				15		// %TRUE if elements are fixed size, like fixed strings or UDT
	#define Array_PtrToData						30		// Pointer to memory area holding data

	#define Array_UBoundDim_1					91		// Returns the Upper Bound of dimension 1
	#define Array_UBoundDim_2					92		// Returns the Upper Bound of dimension 2
	#define Array_UBoundDim_3					93		// Returns the Upper Bound of dimension 3



	/*---------------------------------------------------------------------------
	'thinBasic_AddEquate
	'----------------------------------------------------------------------------
	' Add a new equate (constant)
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) _thinBasic_AddEquate(char* vName, char* lValString, long double lValNumber, int ForceType);
	#define thinBasic_AddEquate _thinBasic_AddEquate

	//---Used for thinBasic_AddEquate to force an equate type in case of missing first char $ or %
	#define EquateTypeAuto						0
	#define EquateTypeNumber					3
	#define EquateTypeString					5



	/*---------------------------------------------------------------------------
	'thinBasic_AddVariable
	'----------------------------------------------------------------------------
	' Add a new variable to current stack level
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_AddVariable(char* vName, char* lValString, long double lValNumber, int ForceType, int VarMemPtr, int Reserved1, int Reserved2, int Reserved3, int Reserved4);



	/*---------------------------------------------------------------------------
	'thinBasic_AddUdt
	'----------------------------------------------------------------------------
	' Add a new UDT structure
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_AddUdt(char* sUDT_Code);



	/*---------------------------------------------------------------------------
	'thinBasic_DeclareFunction
	'----------------------------------------------------------------------------
	' Add a new function using DECLARE statement and function pointer
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_DeclareFunction(char* sDeclare, DWORD pFun);



	/*---------------------------------------------------------------------------
	'thinBasic_ChangeVariableNumber
	'----------------------------------------------------------------------------
	' Change the value of a numeric variable giving its name a the new value
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ChangeVariableNumber(char* vName, long double lValNumber);



	/*---------------------------------------------------------------------------
	'thinBasic_ChangeVariableString
	'----------------------------------------------------------------------------
	' Change the value of a string variable giving its name a the new value
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ChangeVariableString(char* vName, char* lValNumber);



	/*---------------------------------------------------------------------------
	'thinBasic_GetToken
	'----------------------------------------------------------------------------
	' Returns the next token as token ID.
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_GetToken(int AutoPutBack);



	/*---------------------------------------------------------------------------
	'thinBasic_GetToken
	'----------------------------------------------------------------------------
	' Returns the next token as string.
	'--------------------------------------------------------------------------*/
	LPCSTR		__declspec(dllexport) thinBasic_GetTokenName(int AutoPutBack);



	/*---------------------------------------------------------------------------
	'thinBasic_GetTokenID
	'----------------------------------------------------------------------------
	' Return internal engine unique ID giving the token name
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_GetTokenID(char* TokenName);



	/*---------------------------------------------------------------------------
	'thinBasic_TokenGetCurrentID
	'----------------------------------------------------------------------------
	' Return current token ID
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_TokenGetCurrentID();



	/*---------------------------------------------------------------------------
	'thinBasic_PutBack
	'----------------------------------------------------------------------------
	' Put back into parsing stack the last parsed token
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_Putback(int lPtr);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionExists
	'----------------------------------------------------------------------------
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionExists(char* fName);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionGetPtr
	'----------------------------------------------------------------------------
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionGetPtr(char* fName);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionGetPtr
	'----------------------------------------------------------------------------
	'--------------------------------------------------------------------------*/
	LPCSTR		__declspec(dllexport) thinBasic_FunctionGetName(int FunctionPtr);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionIsCallBack
	'----------------------------------------------------------------------------
	' Determine if fucntion passed as PTR has been defined as CALLBACK function in script
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionIsCallBack(int FunctionPtr);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionGetCBParam
	'----------------------------------------------------------------------------
	' Returns the value of a designated CallBack pseudo variable.
	' ATTENTION: interface function valid only whileinside a callback function       
	'--------------------------------------------------------------------------*/
	//   CBParamType: one of the following equates
	// Parameters:
	#define CBParam_CBHNDL						100
	#define CBParam_CBMSG						110
	#define CBParam_CBCTL						120
	#define CBParam_CBCTLMSG					130
	#define CBParam_CBLPARAM					140
	#define CBParam_CBWPARAM					150
	#define CBParam_CBNMCODE					160
	#define CBParam_CBNMHDR						170
	#define CBParam_CBNMHWND					180
	#define CBParam_CBNMID						190
	//   lError: a pointer to a long variable that will receive possible error variables
	//           Possible errors:
	//                            -10: not inside at any function
	//                            -20: inside a function but not a callback function
	//                            -30: unsupported/invalid CBParamType
	//---------------------------------------------------------------------------
	int			__declspec(dllexport) thinBasic_FunctionGetCBParam(int CBParamType, int* lError);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionGetNumberOfParams
	'----------------------------------------------------------------------------
	' Returns the number of parameters defined in a script function
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionGetNumberOfParams(int FunctionPtr);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionGetReturnMainType
	'----------------------------------------------------------------------------
	' Gets the main data type returned by a script function. See %VarMainType* equates above
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionGetReturnMainType(int FunctionPtr);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionParseAndGetPtr
	'----------------------------------------------------------------------------
	' Parse the next token (or string expression). Check if it is a function name
	' If yes, returns a PTR to internal data function
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionParseAndGetPtr(int CheckIfCallBack);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionSimpleCall
	'----------------------------------------------------------------------------
	' Call a script function and optionally returns it value (numeric or string)
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionSimpleCall(char* FunctionName, long double* ptrEXT, char** ptrSTR);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionSimpleCall_ByPtr
	'----------------------------------------------------------------------------
	' Call a script function and optionally returns it value (numeric or string)
	' This function permits to call script callback functions passing automatic
	' pseudo callbacks variables 
	' USE only when in need of a callback function from module
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionSimpleCall_ByPtr(int FunctionPtr, long double* ptrEXT, char** ptrSTR, int IsCallBack, int lCBHNDL, int lCBMSG, int lCBCTL, int lCBCTLMSG, int lCBLPARAM, int lCBWPARAM, int lCBNMCODE, int lCBNMHDR, int lCBNMHWND, int lCBNMID);



	/*---------------------------------------------------------------------------
	'thinBasic_FunctionCall_ByPtr
	'----------------------------------------------------------------------------
	' Call a script function and optionally returns it value (numeric or string)
	' This function permits to call script functions passing parameters
	' Parameters are passed using a shared memory area made by a sequence of DOUBLEs
	' (8 bytes) one for each parameter to be passed.
	' The paramaters memory area will be interpreted by thinBasic core engine
	' depending by parameters declaration made in script.
	'
	' So far the following type of parameters are supported:
	'   - numeric parameters passed BYVAL up to DOUBLE range
	'
	' Example: if programmer wants to pass 2 parameters, set lModParams = 2 and setup
	' a 16 bytes memory area (2 params * 8 bytes each) where to store the 2 parameter
	' values.
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_FunctionCall_ByPtr(int FunctionPtr, int lModParams, int lModParamsPtr, double* ptrDOUBLE, char** ptrSTR);



	/*---------------------------------------------------------------------------
	'thinBasic_GetKeywordSpeficic
	'----------------------------------------------------------------------------
	' Instruct parser to get next token, test if it a keyword and if yes,
	' check if it is one of the possible keywords passed. If not, a RT-Error
	' will be generated
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_GetKeywordSpeficic(int HideError, int AutoPutBack, int lKey1, int lKey2, int lKey3, int lKey4, int lKey5, int lKey6, int lKey7, int lKey8, int lKey9, int lKey10, int lKey11, int lKey12, int lKey13, int lKey14, int lKey15, int lKey16, int lKey17, int lKey18, int lKey19, int lKey20, int lKey21, int lKey22, int lKey23, int lKey24, int lKey25);



	/*---------------------------------------------------------------------------
	'thinBasic_GetKeywordSpeficic_Single
	'----------------------------------------------------------------------------
	' Instruct parser to get next token, test if it a keyword and if yes,
	' check if it is the one requested keyword. If not, a RT-Error
	' will be generated
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_GetKeywordSpeficic_Single(int HideError, int AutoPutBack, int lKey1);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableParse
	'----------------------------------------------------------------------------
	' Instruct parser to get next token, check if variable, check if array and
	' return info needed to subsequent change variable value
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableParse(int* VariablePtr, int* VariableAbsPos);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableParsePtr
	'----------------------------------------------------------------------------
	' Instruct parser to get next token, check if variable
	' return its pointer
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableParsePtr(int* VariablePtr);



	/*---------------------------------------------------------------------------
	'thinBasic_ParsePtrToSomething
	'----------------------------------------------------------------------------
	' Parse whatever and return a PTR to something
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) _thinBasic_ParsePtrToSomething(int* VariablePtr);
	#define thinBasic_ParsePtr _thinBasic_ParsePtr



	/*---------------------------------------------------------------------------
	'thinBasic_ParsePtrToStringAndLen
	'----------------------------------------------------------------------------
	' Parse a dynamic string (scalar or UDT element) and return:
	'   - internal variable pointer (if possible)
	'   - pointer to dynamic string (STRPTR)
	'   - current string len
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ParsePtrToStringAndLen(int* VariablePtr, int* pStr, int* lLen);



	/*---------------------------------------------------------------------------
	'thinBasic_VariablePtrToDirectPtr
	'----------------------------------------------------------------------------
	' Convert a variable ptr to its internal ptr
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariablePtrToDirectPtr(int VariablePtr);



	/*---------------------------------------------------------------------------
	'thinBasic_DirectPtrToDataPtr
	'----------------------------------------------------------------------------
	' Convert a variable ptr to its data ptr
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_DirectPtrToDataPtr(int DirectPtr);



	/*---------------------------------------------------------------------------
	'thinBasic_VariableParseAndGetInfo
	'----------------------------------------------------------------------------
	'
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_VariableParseAndGetInfo(char** VariableName, int* VariablePtr, int* MainType, int* SubType, int* DataPtr, int* nElements);



	/*---------------------------------------------------------------------------
	'thinBasic_ParseVariableInfo
	'----------------------------------------------------------------------------
	' Parameters (all passed BYREF ... AS LONG):
	'   - VariablePtr       pointer to internal thinBasic Core engine data structure
	'                       used to store variable info
	'   - MainType          variable main type
	'   - SubType           variable sub type
	'   - ElementsAreFixed  %TRUE if elements inside data buffer are fixed size.
	'                       For example will return %TRUE:
	'                         - fixed STRING size, the one declared ... AS STRING * size
	'                         - fixed ASCIIZ size, the one declared ... AS ASCIIZ * size
	'                         - UDT variables
	'   - TotElements       total number of elements in variable. Usually 1 if
	'                       variable is not an array
	'   - ElementSize       size of the single element. For example if variable is a
	'                       LONG, ElementSize = 4. If EXT ElementSize = 10
	'                       if variable is a UDT, it will depend from UDT to UDT.
	'   - DataPtr           pointer to variable data 
	'   - AbsPos            absolute position inside the array if variable is an array
	'                       if variable is not an array 1 is returned
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ParseVariableInfo(int* VariablePtr, int* MainType, int* SubType, int* ElementsAreFixed, int* TotElements, int* ElementSize, int* DataPtr, int* AbsPos);



	/*---------------------------------------------------------------------------
	'thinBasic_ChangeVariableStringDirect
	'----------------------------------------------------------------------------
	' See also thinBasic_VariableParse
	'
	' Change a variable using direct variable pointer's data returned by
	' thinBasic_VariableParse. This will ensure to work also with arrays
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ChangeVariableStringDirect(int VariablePtr, int VariableAbsPos, char* lValString);



	/*---------------------------------------------------------------------------
	'thinBasic_ChangeVariableNumberDirect
	'----------------------------------------------------------------------------
	' See also thinBasic_VariableParse
	'
	' Change a variable using direct variable pointer's data returned by
	' thinBasic_VariableParse. This will ensure to work also with arrays
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ChangeVariableNumberDirect(int VariablePtr, int VariableAbsPos, long double lValNumber);



	/*---------------------------------------------------------------------------
	'thinBasic_GetVariableNumberDirect
	'----------------------------------------------------------------------------
	'
	' Returns the value of a variable giving its ptr and it abs position
	'--------------------------------------------------------------------------*/
	long double	__declspec(dllexport) thinBasic_GetVariableNumberDirect(int VariablePtr, int VariableAbsPos);



	/*---------------------------------------------------------------------------
	'thinBasic_ChangeVariableUDTDirect
	'----------------------------------------------------------------------------
	' See also thinBasic_VariableParse
	'
	' Change a variable using direct variable pointer's data returned by
	' thinBasic_VariableParse. This will ensure to work also with arrays
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ChangeVariableUDTDirect(int VariablePtr, int VariableAbsPos, char* lValString);



	/*---------------------------------------------------------------------------
	' NOTE
	'----------------------------------------------------------------------------
	' The following functions
	'
	'    thinBasic_ParseNumber
	'    thinBasic_ParseString
	'    thinBasic_CheckOpenParens
	'    thinBasic_CheckCloseParens
	'    thinBasic_CheckComma
	'
	' are used inside user defined functions/subs to parse function params.
	' Imagine you want create a user def function like:
	'
	'    MyFunct(String1, String2, Number1)
	'
	' To get params you have to parse the following tokens:
	'    (           Open parens
	'      String1     a string expression
	'      ,           a comma
	'      String2     a second string expression
	'      ,           another comma
	'      Number1     a numeric expression
	'    )           Finally close parens
	'
	' thinBasic gives this ability using 5 simple functions to parse user expressions.
	' Let's take again the above example and see how to write a user defined
	' function that returns a STRING
	'
	' FUNCTION MyLeft() AS STRING
	' 'Syntax: Number = MyLeft(S1, S2, N1)
	'   LOCAL lString1 AS STRING                           'Define first string param
	'   LOCAL lString2 AS STRING                           'Define second string param
	'   LOCAL lNumber1 AS EXT                              'Define third number param
	'   IF thinBasic_CheckOpenParens THEN                  'Check if open parens token found
	'     thinBasic_ParseString lString1                   'Now evaluate a string expression
	'     IF thinBasic_CheckComma THEN                     'Check if there is a comma
	'       thinBasic_ParseString lString2                 'Parse another string expression
	'       IF thinBasic_CheckComma THEN                   'Another comma
	'         thinBasic_ParseNumber lNumber1               'Now get a numeric expression
	'         IF thinBasic_CheckCloseParens THEN           'Finally a close parens
	'           FUNCTION = LEFT$(lString1, lNumber1) + _   '...here we are.Here you can assign
	'                      LEFT$(lString2, lNumber1)       '...to your function whatever value
	'         END IF                                       '...using the evaluated params
	'       END IF
	'     END IF
	'   END IF
	' END FUNCTION
	'
	'
	' thinBasic_CheckOpenParens
	' thinBasic_CheckCloseParens
	' thinBasic_CheckComma
	' have the following optional parameters:
	'
	'   HideHerror 
	'               if %TRUE, in case of parsing problems, no runtime error will
	'               be generated
	'   AutoPutBack
	'               if %TRUE, in case of parsing problems, the found token
	'               will be put back into parsing stack
	'
	'--------------------------------------------------------------------------*/
	void		__declspec(dllexport) thinBasic_ParseNumber(long double* Result);
	void		__declspec(dllexport) thinBasic_ParseByte(BYTE* Result);
	void		__declspec(dllexport) thinBasic_ParseInteger(INT16* Result);
	void		__declspec(dllexport) thinBasic_ParseWord(WORD* Result);
	void		__declspec(dllexport) _thinBasic_ParseDWord(DWORD* Result);
	int			__declspec(dllexport) thinBasic_ParseLong(int* Result);
	void		__declspec(dllexport) thinBasic_ParseQuad(INT64* Result);
	void		__declspec(dllexport) thinBasic_ParseSingle(float* Result);
	void		__declspec(dllexport) _thinBasic_ParseDouble(double* Result);
	void		__declspec(dllexport) thinBasic_ParseExt(long double* Result);
	#define thinBasic_ParseLong_Optional thinBasic_ParseLong
	#define thinBasic_ParseDWord _thinBasic_ParseDWord
	#define thinBasic_ParseDouble _thinBasic_ParseDouble
	
	long double	__declspec(dllexport) thinBasic_Parse1Number();
	long double	__declspec(dllexport) thinBasic_Parse2Numbers(long double* Num1, long double* Num2);
	long double	__declspec(dllexport) thinBasic_Parse3Numbers(long double* Num1, long double* Num2, long double* Num3);
	long double	__declspec(dllexport) thinBasic_Parse4Numbers(long double* Num1, long double* Num2, long double* Num3, long double* Num4);
	long double	__declspec(dllexport) thinBasic_Parse5Numbers(long double* Num1, long double* Num2, long double* Num3, long double* Num4, long double* Num5);
	long double	__declspec(dllexport) thinBasic_Parse6Numbers(long double* Num1, long double* Num2, long double* Num3, long double* Num4, long double* Num5, long double* Num6);
	long double	__declspec(dllexport) thinBasic_Parse7Numbers(long double* Num1, long double* Num2, long double* Num3, long double* Num4, long double* Num5, long double* Num6, long double* Num7);

	long double	__declspec(dllexport) thinBasic_Parse2Numbers1String(long double* Num1, long double* Num2, char** s1);
	long double	__declspec(dllexport) thinBasic_Parse3Numbers1String(long double* Num1, long double* Num2, long double* Num3, char** s1);

	long double	__declspec(dllexport) thinBasic_ParseXNumbers(int MinNumToParse, int MaxNumToParse, long double* Num1, long double* Num2, long double* Num3, long double* Num4, long double* Num5, long double* Num6, long double* Num7, long double* Num8, long double* Num9, long double* Num10);
	long double	__declspec(dllexport) thinBasic_ParseXNumbersExt(int MinNumToParse, int MaxNumToParse, long double* Num1, long double* Num2, long double* Num3, long double* Num4, long double* Num5, long double* Num6, long double* Num7, long double* Num8, long double* Num9, long double* Num10, long double* Num11, long double* Num12, long double* Num13, long double* Num14, long double* Num15);

	long double	__declspec(dllexport) thinBasic_Parse1StringXNumbers(int MinNumToParse, int MaxNumToParse, char** Str1, long double* Num1, long double* Num2, long double* Num3, long double* Num4, long double* Num5, long double* Num6, long double* Num7, long double* Num8, long double* Num9, long double* Num10);

	long double	__declspec(dllexport) thinBasic_Parse1String2Numbers(char** Str1, long double* Num1, long double* Num2);

	long double	__declspec(dllexport) thinBasic_Parse1Number2Strings(long double* Num1, char** Str1, char** Str2);

	long double	__declspec(dllexport) thinBasic_Parse1Number1String(long double* Num1, char* Str1);

	// Parse one string expression including possible "(" and ")" before and after the string
	// This function is the equavalent of the numeric thinBasic_Parse1Number 
	LPCSTR		__declspec(dllexport) thinBasic_Parse1String();

	// Parse one string expression. It also returns the numeric representation of the parsed string in case it represents a valid number
	long double	__declspec(dllexport) _thinBasic_ParseString(char** sResult);
	#define thinBasic_ParseString _thinBasic_ParseString

	// Parse one string expression.
	void		__declspec(dllexport) _thinBasic_ParseStr(char** sResult);
	#define thinBasic_RunTimeError _thinBasic_RunTimeError

	// Parse a variant variable (scalar or array) and returns its pointer
	DWORD		__declspec(dllexport) _thinBasic_ParseVariant();
	#define thinBasic_ParseVariant _thinBasic_ParseVariant

	int			__declspec(dllexport) _thinBasic_CheckOpenParens(int HideError, int AutoPutBack);
	int			__declspec(dllexport) thinBasic_CheckOpenParens_Mandatory();
	int			__declspec(dllexport) thinBasic_CheckOpenParens_Optional();
	#define thinBasic_CheckOpenParens _thinBasic_CheckOpenParens

	int			__declspec(dllexport) _thinBasic_CheckCloseParens(int HideError, int AutoPutBack);
	int			__declspec(dllexport) thinBasic_CheckCloseParens_Mandatory();
	int			__declspec(dllexport) thinBasic_CheckCloseParens_Optional();
	#define thinBasic_CheckCloseParens _thinBasic_CheckCloseParens

	int			__declspec(dllexport) _thinBasic_CheckComma(int HideError, int AutoPutBack);
	int			__declspec(dllexport) thinBasic_CheckComma_Mandatory();
	int			__declspec(dllexport) thinBasic_CheckComma_Optional();
	#define thinBasic_CheckComma _thinBasic_CheckComma

	int			__declspec(dllexport) thinBasic_CheckSemicolon_Mandatory();
	int			__declspec(dllexport) thinBasic_CheckSemicolon_Optional();

	int			__declspec(dllexport) thinBasic_CheckEqual_Mandatory();
	int			__declspec(dllexport) thinBasic_CheckEqual_Optional();

	int			__declspec(dllexport) thinBasic_CheckPoint_Mandatory();
	int			__declspec(dllexport) thinBasic_CheckPoint_Optional();

	int			__declspec(dllexport) thinBasic_CheckPlus_Optional();
	int			__declspec(dllexport) thinBasic_CheckMinus_Optional();
	int			__declspec(dllexport) thinBasic_CheckMult_Optional();
	int			__declspec(dllexport) thinBasic_CheckDiv_Optional();

	int			__declspec(dllexport) thinBasic_CheckEOL_Optional();

	LPCSTR		__declspec(dllexport) thinBasic_GetUnknownToken(int AutoPutBack);

	//----------------------------------------------------------------------------

	int			__declspec(dllexport) thinBasic_CheckEqualType_Mandatory();
	#define Equal_EQ			2021
	#define Equal_PLUSEQUAL		2022
	#define Equal_MINUSEQUAL	2023
	#define Equal_MULTIPLYEQUAL	2024
	#define Equal_DIVIDEEQUAL	2025
	#define Equal_IDIVIDEEQUAL	2026
	#define Equal_CONCEQUAL		2027
	#define Equal_POINTEQUAL	2028

	//----------------------------------------------------------------------------

	int			__declspec(dllexport) thinBasic_DetermineType();

	/*---------------------------------------------------------------------------        
	' Determine if next token is a token (whatever) that will start a string or numeric operation sequence
	'----------------------------------------------------------------------------        
	' Possible return values:
	'   %thinBasic_ReturnNumber
	'   %thinBasic_ReturnString
	'--------------------------------------------------------------------------*/



	/*---------------------------------------------------------------------------
	'thinBasic_GetRunTimeInfo
	'----------------------------------------------------------------------------
	' The following information can be taken:
	'  "SCRIPT_PATH"  Path to script
	'  "APP_PATH"     Path to thinBasic
	'  "HWND"         Handle to main thinBasic window
	'--------------------------------------------------------------------------*/
	LPCSTR		__declspec(dllexport) thinBasic_GetRunTimeInfo(char* InfoName);



	/*---------------------------------------------------------------------------
	'thinBasic_ScriptIsObuscated
	'----------------------------------------------------------------------------
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ScriptIsObfuscated();



	/*---------------------------------------------------------------------------
	'Trace Handling
	'----------------------------------------------------------------------------
	'--------------------------------------------------------------------------*/
	// TRACE Equates
	// ---What to ask for
	#define TRACE_What_SourcePtr						1
	#define TRACE_What_StackLevel						10
	#define TRACE_What_IFLevel							20
	#define TRACE_What_SourceFullPath					30

	// ---Error codes
	#define TRACE_Error_NotPossible_Obfuscated			1
	#define TRACE_Error_InstallHandle_Null				200
	#define TRACE_Error_InstallHandle_AlreadyInstalled	201



	/*---------------------------------------------------------------------------
	'thinBasic_ITrace_GetValue
	'----------------------------------------------------------------------------
	' 
	'  
	'  
	'  
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ITrace_GetValue(int lWhat, char* sWhat, int* lRet1, int* lRet2, char** sRet1);



	/*---------------------------------------------------------------------------
	'thinBasic_ITrace_InstallHandle
	'----------------------------------------------------------------------------
	' 
	' 
	'
	'
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ITrace_InstallHandle(int fHandle);



	/*---------------------------------------------------------------------------
	'thinBasic_StackGetCurrent
	'----------------------------------------------------------------------------
	' Returns the current script stack level.
	' 1 = Global, 2 = next function executed, 3 = ...
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_StackGetCurrent();



	/*---------------------------------------------------------------------------
	'thinBasic_StackGetList
	'----------------------------------------------------------------------------
	' Returns a string containing the names of the current nesting stack levels
	' As a minimum this function will return one string containing "GLOBAL"
	'--------------------------------------------------------------------------*/
	LPCSTR		__declspec(dllexport) thinBasic_StackGetList(char* sSep);



	/*---------------------------------------------------------------------------
	'ERROR Handling
	'--------------------------------------------------------------------------*/



	/*---------------------------------------------------------------------------
	'thinBasic_GetLastError
	'----------------------------------------------------------------------------
	' Returns the last occurred error code
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_GetLastError();



	/*---------------------------------------------------------------------------
	'thinBasic_ErrorFlag
	'----------------------------------------------------------------------------
	' Returns a value different from 0 if a runtime error occurred
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ErrorFlag();



	/*---------------------------------------------------------------------------
	'thinBasic_ErrorFree
	'----------------------------------------------------------------------------
	' Returns -1 if there thinBasic is not under runtime error state
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ErrorFree();



	/*---------------------------------------------------------------------------
	'thinBasic_ErrorUserConfirmed
	'----------------------------------------------------------------------------
	' Returns -1 if, after an error, user has confirmed the dialog
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ErrorUserConfirmed();



	/*---------------------------------------------------------------------------
	'thinBasic_RunTimeError
	'----------------------------------------------------------------------------
	' Use internal thinCore engine to generate a runtime error
	'  ErrorCode      Error code. Get one from the below list
	'  AdditionalInfo Personalized text to be shown into runtime error dialog
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_RunTimeError(int ErrorCode, char* AdditionalInfo);



	/*---------------------------------------------------------------------------
	'thinBasic_GetControllingLevels
	'----------------------------------------------------------------------------
	' Return current nidification levels of commonly used flow controlling keywords
	' All parameters are LONGs passed BYREF and are used to get back levels
	' from thinBasic Core Engine
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_GetControllingLevels(int* Level_If, int* Level_Select, int* Level_For, int* Level_While, int* Level_Do);



	/*-----------------------------------------------------------------------------
	' RunTime Errors Codes
	'----------------------------------------------------------------------------*/
	#define ERR__PARENS									1
	#define ERR__NOEXP									2
	#define ERR__DIV_ZERO								3
	#define ERR__EQUAL_EXP								4
	#define ERR__NOT_VAR								5
	#define ERR__LAB_TAB_FULL							6
	#define ERR__DUP_LAB								7
	#define ERR__UNDEF_LAB								8
	#define ERR__THEN_EXPECTED							9
	#define ERR__TO_EXPECTED							10
	#define ERR__TOO_MANY_FOR							11
	#define ERR__NEXT_WITHOUT_FOR						12
	#define ERR__MISSING_SEMICOLON						13

	#define ERR__COMMAND_RET_NONE_IN_EXPRESSION			14

	#define ERR__MISS_QUOTE								15
	#define ERR__BAD_FILE								16
	#define ERR__STR_EXPECTED							17
	#define ERR__UNKNOWN_KEYWORD						18
	#define ERR__MISSING_OPENPARENS						19
	#define ERR__MISSING_CLOSEPARENS					20
	#define ERR__MISSING_COMMA							21
	#define ERR__MISSING_SQUARECLOSEPARENS				22

	#define ERR__EOL_INCORRECT							23

	#define ERR__DOUBLE_CONCATENATION					24
	#define ERR__COMMAND_UNKNOWN_RETURNED_PARAMETER		25
	#define ERR__PRIMITIVE_STR							26
	#define ERR__PRIMITIVE_NUM							27
	#define ERR__PRINT_ERROR							28
	#define ERR__PRINT_ERROR_NOENDOFLINE				29
	#define ERR__VARIABLE_NOT_DEFINED					30
	#define ERR__ATOM_TOKEN_TYPE_NUMERIC				31
	#define ERR__ATOM_NUM								31		// ---Used as an abbreviation in macros
	#define ERR__IF_WITHOUT_ENDIF						32
	#define ERR__IF_ENDIF_WITHOUT_IF					33
	#define ERR__TOO_MANY_WHILE							34
	#define ERR__WHILE_WITHOUT_WEND						35
	#define ERR__DIM_TYPE_NOT_DEFINED					36
	#define ERR__EXIT_NO_KEY_FOUND						37
	#define ERR__NO_END_FUNCTION_FOUND					38
	#define ERR__FUNCTION_NAME_DUPLICATE				39
	#define ERR__FUNCTION_NAME_IS_KEY					40
	#define ERR__FUNCTION_NAME_IS_VAR					41
	#define ERR__FUNCTION_NAME_IS_UDT					42
	#define ERR__END_NO_KEY_FOUND						43

	#define ERR__DIM_MISSING_AS							44
	#define ERR__UNDEFINED_TOKEN						45
	#define ERR__UNSUPPORTED_CHAR						46

	#define ERR__FUNCTION_DECLARE_MISSING_AS			47
	#define ERR__DECLARE_FUNCTION_OR_SUB_EXPECTED		48

	#define ERR__DOLOOP_WRONG_CONDITION					49

	#define ERR__MISSING_ALIAS							50
	#define ERR__MISSING_LIB							51
	#define ERR__UNDEFINED_VAR_TYPE						52
	#define ERR__PARAMETER_BYREF_INCORRECT_PTR			53

	#define ERR__LOOP_EXPECTED_WHILE_OR_UNTIL			55

	#define ERR__END_FUNCTION_WITHOUT_FUNCTION			58
	#define ERR__END_FUNCTION_FOUND						59

	#define ERR__ITERATE_NO_KEY_FOUND					60

	#define ERR__WITH_ENDWITH_ERROR						64

	#define ERR__TOO_NESTED_DOLOOP						65
	#define ERR__DOLOOP_MISSING_DO_OR_LOOP				66

	#define ERR__VARIABLE_NOT_DIMENSIONED				70
	#define ERR__VARIABLE_ISNOT_ARRAY					71
	#define ERR__VARIABLE_MUSTBE_STRING_TYPE			72

	#define ERR__REDIM_NEW_TYPE_NOT_SUPPORTED			73
	#define ERR__REDIM_PRESERVE_NOTVALID_ABSOLUTE		74

	#define ERR__VARIABLE_MUSTBE_UDT_TYPE				75

	#define ERR__KEYWORD_NOT_EXPECTED					76
	#define ERR__TOKEN_NOT_EXPECTED						77

	#define ERR__INCLUDE_FILE_NOT_FOUND					80
	#define ERR__INCLUDE_FILE_NOT_FOUND_INET_GENERIC	81
	#define ERR__INCLUDE_FILE_NOT_FOUND_INET_CONNECTION	82
	#define ERR__INCLUDE_FILE_NOT_FOUND_INET_OPENURL	83
	#define ERR__INCLUDE_FILE_NOT_FOUND_INET_404		84

	#define ERR__DIM_UNEXPECTED_KEYWORD					85

	#define ERR__FUNCTION_NOT_SUPPORTED					90

	#define ERR__ARRAY_FUNCTION_NOT_SUPPORTED			91

	#define ERR__UDT_ELEMENT_NOT_FOUND					100
	#define ERR__UDT_EXPECTED							101
	#define ERR__UDT_EQU_OR_ELEMENT_EXPECTED			102

	#define ERR__ASSIGNMENT_NOT_SUPPORTED				110

	#define ERR__RELATIONAL_EXPECTED					115

	#define ERR__API_LIB_NOT_FOUND						120
	#define ERR__API_FUNCTION_NOT_FOUND_IN_LIB			121
	#define ERR__API_GENERAL_ADDRESS_NOT_PRESENT		122

	#define ERR__CALL_NOTSUPPORTEDSTATEMENT				130
	#define ERR__CALL_FUNCTIONNOTFOUND					131

	#define ERR__FUNCTIONNOTFOUND						133
	#define ERR__FUNCTION_EXPECTED_CALLBACK				134

	#define ERR__EQUATE_ALREADY_DEFINED					135
	#define ERR__EQUATE_ALREADY_DEFINED_DIFFERENT		136

	#define ERR__VARIABLE_NAME_DUPLICATE_GLOBAL			142
	#define ERR__VARIABLE_NAME_DUPLICATE_FUNCTION		144
	#define ERR__VARIABLE_NAME_DUPLICATE_LOCAL			145
	#define ERR__VARIABLE_NAME_DUPLICATE				146

	#define ERR__FOR_StepShouldBeNegative				150
	#define ERR__FOR_StepShouldBePositive				151
	#define ERR__FOR_ExpectedAVariable					152
	#define ERR__FOR_StepIsZero							153
	#define ERR__FOR_VarMustBeNumeric					154

	#define ERR__ALIAS_CommandNameExpected				160
	#define ERR__ALIAS_AsExpected						161
	#define ERR__ALIAS_UndefNotUndef					162

	#define ERR__TYPE_MISSING_END_UNION					169
	#define ERR__TYPE_MISSING_END_TYPE					170
	#define ERR__TYPE_MISSING_END_CLASS					171
	#define ERR__TYPE_TYPE_NOT_DEFINED					172
	#define ERR__TYPE_MISSING_AS						173
	#define ERR__TYPE_NAME_MUSTBE_UNDEFINED				174
	#define ERR__TYPE_ARRAY_MUSTBE_DIMENSIONED			175
	#define ERR__TYPE_STRINGS_MUST_HAVE_SIZE			176
	#define ERR__TYPE_ELEMENT_ALREADY_PRESENT			177
	#define ERR__TYPE_ELEMENT_ALREADY_PRESENT_INHERIT	178
	#define ERR__TYPE_DYNSTRING_INSIDE_UNION			179

	#define ERR__NO_END_RAWTEXT_FOUND					180

	#define ERR__BEGIN_BLOCK_UNSUPORTED					190
	#define ERR__BEGIN_CONST_MISSING_END				191

	#define ERR__FUNCTION_PARAM_UNRECOGNIZED_TYPE		220

	#define ERR__DO_WITHOUT_LOOP						245
	#define ERR__FUNCTION_MISSING_AS					246
	#define ERR__REGEXPR_MISSING_TO						247
	#define ERR__REGEXPR_MISSING_IN						248
	#define ERR__SELECT_WITHOUT_ENDSELECT				249
	#define ERR__DUPLICATE_SYMBOL						250
	#define ERR__INVALIDNUMERICCHAR						251
	#define ERR__INVALIDDELIMITER						252
	#define ERR__INVALIDDATATYPE						253
	#define ERR__VARIABLE_EXPECTED						254
	#define ERR__VARIABLE_VARIANT_EXPECTED				255

	#define ERR__SELECT_MISSING_CASE					270
	#define ERR__SELECT_ERROR_KINDOF_OPERATION			271
	#define ERR__SELECT_CODE_BETWEEN_SELECT_CASE		272

	#define ERR__STRPTR_VARIABLE_NOT_A_DYNSTRING_NUM	280
	#define ERR__STRPTR_VARIABLE_NOT_A_DYNSTRING_VAR	281
	#define ERR__STRPTR_VARIABLE_NOT_A_DYNSTRING_UDT	282

	#define ERR__APICALL_REF_EXPECTED					300

	#define ERR__ARRAY_OUT_OF_BOUND						400

	#define ERR__MODULE_SPECIFIC						500

	#define ERR__PREPARSER_DirectiveNotSupported		800

	#define ERR__PREPARSER_ScriptVersionRequest			820

	#define ERR__INTERNAL_RETURNMAINTYPE				900

	#define ERR__INTERNAL_DECRIPTION					910

	#define ERR__INTERNAL_UDTBUFFER_SHORT				915

	#define ERR__INTERNAL_RETURNNONE_NOCODEPTR			921
	#define ERR__INTERNAL_RETURNNUMBER_NOCODEPTR		922
	#define ERR__INTERNAL_RETURNSTRING_NOCODEPTR		923

	#define ERR__CLASS_NEW_NOINDEXALLOWED				5010
	#define ERR__CLASS_NEW_DIFFERENTCLASS				5015
	#define ERR__CLASS_NEW_NOCLASS						5020
	#define ERR__CLASS_NEW_EXPECTED_NEW					5025
	#define ERR__CLASS_NOT_INIT_WITH_NEW				5030
	#define ERR__CLASS_SET_NOW_ALLOWED					5035

	#define ERR__CLASS_METHODPROPERTY_NOTFOUND			5100
	#define ERR__CLASS_EXPECTED							5110

	#define ERR__TRACE_STOP_BY_USER						11000

	#define ERR__OBFUSCATION_FILENOTVALID				12000

	#define ERR__COM_GENERIC							30000

	#define ERR__GENERIC								62000
	
	
	
	/*---------------------------------------------------------------------------
	'thinBasic_Class_Add
	'----------------------------------------------------------------------------
	' Add a new class to thinBasic Core Engine
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_Class_Add(char* sClassName, int pClassFunc);



	/*---------------------------------------------------------------------------
	'thinBasic_Class_AddMethod
	'----------------------------------------------------------------------------
	' Add a method to a class previously created with thinBasic_Class_Add
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_Class_AddMethod(int pClass, char* sMethodName, int MethodReturnType, void* pMethodFunc);



	/*---------------------------------------------------------------------------
	'thinBasic_ParseClass
	'----------------------------------------------------------------------------
	' Return pointer to a class. Use it to map your internal module class
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_ParseClass();

	#define Class_Action_None			0
	#define Class_Action_Get			1
	#define Class_Action_Set			2

	#define Class_Action_Constructor	100
	#define Class_Action_Destructor		110



	/*---------------------------------------------------------------------------
	'thinBasic_Class_AddProperty
	'----------------------------------------------------------------------------
	' Add a property to a class previously created with thinBasic_Class_Add
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_Class_AddProperty(int pClass, char* sPropertyName, int PropertyReturnType, int PtrToPropertyFunction);



	/*---------------------------------------------------------------------------
	'thinBasic_IsBundled
	'----------------------------------------------------------------------------
	' %TRUE if current execution is started from a bundled executable
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_IsBundled();



	/*---------------------------------------------------------------------------
	'thinBasic_IsIsolated
	'----------------------------------------------------------------------------
	' %TRUE if current execution is started from a bundled executable and
	' isolation mode is taking place. In isolation mode all modules/dlls are
	' extracted into a temp directory created at script runtime and
	' destroyed when script stop execution
	'----------------------------------------------------------------------------
	' If script is bundled also Isoaltion is %TRUE
	' In future maybe execution of script and extraction of modules will
	' take place directly from memory
	'--------------------------------------------------------------------------*/
	int			__declspec(dllexport) thinBasic_IsBundled();
	int			__declspec(dllexport) thinBasic_IsIsolated();



	/*---------------------------------------------------------------------------
	'thinBasic_IsolationPath
	'----------------------------------------------------------------------------
	' Returns isoaltion path. See thinBasic_IsIsolated
	'--------------------------------------------------------------------------*/
	LPCSTR		__declspec(dllexport) thinBasic_IsolationPath();
}



